using System;
using System.Collections.Generic;
using System.Text;

namespace Incubator.OTWorkflow
{
    [Serializable]
    public class OTStateService : IOTStateService
    {

        public event EventHandler<OTStateEventArgs> OTAsignada;
        public event EventHandler<OTStateEventArgs> OTIniciada;
        public event EventHandler<OTStateEventArgs> OTFinalizada;

        public void RaiseOTAsignadaEvent(Guid id, string codOT)
        {
            if (OTAsignada != null)
            {
                OTStateEventArgs args = new OTStateEventArgs(id, codOT);
                OTAsignada(this, args);
            }
        }

        public void RaiseOTIniciadaEvent(Guid id, string codOT)
        {
            if (OTIniciada != null)
            {
                OTStateEventArgs args = new OTStateEventArgs(id, codOT);
                OTIniciada(this, args);
            }
        }

        public void RaiseOTFinalizadaEvent(Guid id, string codOT)
        {
            if (OTFinalizada != null)
            {
                OTStateEventArgs args = new OTStateEventArgs(id, codOT);
                OTFinalizada(this, args);
            }
        }
    }
}
